package homework;

public class Test6 {
    public static void main(String[] args) {
        int[] a={};
        int[] b={1,2,3};
        //toChar();
        toChar(a);
        toChar(b);
    }
    public static void toChar(int[] ints){
        StringBuilder sb=new StringBuilder("[");
        for (int i = 0; i <=ints.length; i++) {
            if (i==ints.length){
                sb.append("]");
            }
            else if (i==ints.length-1){
                sb.append(ints[i]);
            }else{
                sb.append(ints[i]).append(",");

            }
        }
        System.out.println(sb.toString().toCharArray());
    }
}
